package com.lcx.movie.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lcx.movie.entity.Snacks;
import com.lcx.movie.entity.UserRating;
import com.lcx.movie.mapper.SnacksMapper;
import com.lcx.movie.mapper.UserRatingMapper;
import com.lcx.movie.service.SnacksService;
import com.lcx.movie.service.UserRatingService;
import org.apache.ibatis.annotations.Param;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 李丽君
 * @version 1.0
 * @Description 用户评分
 * @date 2025/2/28 14:00
 */
@Service
public class UserRatingServiceImpl extends ServiceImpl<UserRatingMapper, UserRating> implements UserRatingService {
    @Autowired
    private UserRatingMapper userRatingMapper;

    /**
     * 用户评分
     * @param userRating 评分实体
     * @return 受影响的行数
     */
    @Override
    public int insertUserRating(UserRating userRating){
        return userRatingMapper.insert(userRating);
    }

    /**
     * 查询用户评分
     * @param userName 用户名
     * @param movieCnName 电影名
     * @return 用户评分集合
     */
    @Override
    public List<UserRating> selectUserRating(@Param("userName") String userName,@Param("movieCnName") String movieCnName){
        return userRatingMapper.selectUserRating(userName,movieCnName);
    }

}
